<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>test</title>
    <style>
        .container {
            position: absolute;
            width: 0;
            height: 0;
            margin: 0;
            opacity: 1;
            left: 50%;
            top: 50%;
            transform: translate(0,0) rotate(0) scale(1,1);
            transform-origin: 50% 50%;
        }
        .container div {
            position: absolute;
            width: 12px;
            height: 12px;
            margin: -6px 0 0 -6px;
            opacity: 1;
            left: 50%;
            top: 50%;
            transform-origin: 50% 50%;
            /* background-color: #ccc; */
        }
    </style>
</head>
<body>
    <div class="container"></div>
</body>
<script src="util/jquery1.9.1.min.js"></script>
<script>
    $(function(){
        var colorList = ['yellow','red','green','purple','#007788']
        var $divP = $('.container');
        for(var i = 0;i<30;i++){
            $('<div></div>').appendTo($divP);
            $divs = $('.container div');
            $($divs[i]).css('background','colorList['+i%5+']')
        }
    })
</script>
</html>